<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>小灵客户关系管理系统</title>
<link rel="stylesheet" href="/static/css/style.css">
<jsp:include page="/static/common/common_header.jsp"/>
    <script type="text/javascript">

        $(function () {

            $("#submitBtn").click(function () {

                //使用easyui-form来提交表单
                $("#loginForm").form("submit",{

                    url:"/login",
                    success:function(data){

                        data = $.parseJSON(data);
                        console.log(data);
                        if(data.success){

                                 window.location.href="/main";
                        }else{

                                $.messager.alert("温馨提示",data.massage,"error");
                        }
                    }

                })

            });

        })
    </script>

</head>
<body>
  <section class="container">
    <div class="login">
      <h1>用户登录</h1>
      <form method="post" id="loginForm">
        <p><input type="text" name="username" value="" placeholder="账号"></p>
        <p><input type="password" name="password" value="" placeholder="密码"></p>
        <p class="submit">
        	<input type="button" value="登录" id="submitBtn">
        	<input type="button" value="重置">
        </p>
      </form>
    </div>
  </section>
<div style="text-align:center;" class="login-help">
	<p>Copyright ©2018 上饶小灵科技有限公司</p>
</div>
</html>